export class Constant {

  // public static URL_BASE = 'http://172.0.1.209';
  public static URL_BASE = Constant.getUrl(true);
  // public static URL_IMG = 'http://ach.ahousepet.com/image/';
  // public static URL_FILE = 'http://ach.ahousepet.com/file/';
  // public static URL_HTML = 'http://ach.ahousepet.com/html/';

  public static DICT_LIST: string = Constant.URL_BASE + '/basic/dict/find';
  /**
   * 管理员模块
   */

  public static ADMIN_LIST: string = Constant.URL_BASE + '/admin/find';
  public static ADMIN_UPDATE: string = Constant.URL_BASE + '/admin/update';
  public static ADMIN_INSERT: string = Constant.URL_BASE + '/admin/insert';
  /**
   * 登陆模块
   */
  public static LOGIN: string = Constant.URL_BASE + '/admin/login';
  public static RESET_PSW: string = Constant.URL_BASE + '/login/resetPsw';
  public static SEND_RESET_PSW: string = Constant.URL_BASE + '/login/sendResetPsw';

  public static getUrl(isDebug): string {
    let url = '';
    if (document.location.protocol === 'http:') {
      // url = 'http://ach.hyktach.com/ach';
      url = 'https://';
    } else {
      url = 'https://';
    }
    if (isDebug) {
      return url + 'ceshi.jyguanjia.com/JYGJMS';
    } else {
      return url + 'three.jyguanjia.com/JYGJMS';
    }

  }
}

